<div class="right-submenu">
	<ul>
		<li><a href="/" title="{"MAIN_PAGE"|i18n}">{"MAIN_PAGE"|i18n}</a></li>
		<li class="last"><span>{"FAQ"|i18n|stripslashes|strip_tags}</span></li>
	</ul>
</div>
<div style="display :none;" id="actionmessage"></div>

<h1>{"FAQ"|i18n|stripslashes|strip_tags}</h1>
{"FAQ_TEXT"|i18n|stripslashes|strip_tags}<br><br>

<div id="form_faq">
	<table class="sendemail">
		<tbody>
			<tr>
				<td></td>
				<td class="formrules"><span class="gh">{"MANDATORY_FIELDS"|i18n|stripslashes|strip_tags}. </span></td>
			</tr>
			<tr><td><label for="form_fio">{"FORM_NAME"|i18n|stripslashes|strip_tags}*</label></td><td><input type="text" class="text" value="" id="form_fio"></td></tr>
			<tr><td><label for="form_email">{"FORM_EMAIL"|i18n|stripslashes|strip_tags}*</label></td><td><input type="text" class="text" value="" id="form_email"></td></tr>
			<tr><td><label for="form_question">{"FORM_QUESTION"|i18n|stripslashes|strip_tags}*</label></td><td><textarea class="text" id="form_question"></textarea></td></tr>		
			<tr><td></td><td><input type="button" value="{"ASK_QUESTION"|i18n|stripslashes|strip_tags}" class="text" id="add_question"></td></tr>
		</tbody>
	</table>
</div>
<p><p><p><p>
<div class="area">
	<table width="100%" border="0" cellspacing="5" cellpadding="5">
		<tr>
			<td colspan=2><hr></td>
		</tr>
	{foreach from=$Faqs item=N}
		<tr>
			<td style="vertical-align:top; font-style: italic"><b>{"FORM_QUESTION"|i18n|stripslashes|strip_tags}:</b> 
			</td>
			<td style="font-style: italic">{$N->question|stripslashes}</td>
		</tr>
		<tr>
			<td style="vertical-align:top"><b>{"FORM_ANSWER"|i18n|stripslashes|strip_tags}:</b></td>
			<td>{$N->answer|stripslashes}</td>
		</tr>
		<tr>
			<td colspan=2><hr></td>
		</tr>
	{/foreach}
	</table>
{if $Faqs->hasPaginate()}	
	<div class="news-title">
	{$Faqs->showUserPager()}
	</div>
{/if}
</div>
{literal}
<script>
$("#add_question").click(function(){
	$(this).attr("disabled","disabled");
	$.post(
		"/ajaxcall/addquestion",
		{
			form_fio: $("#form_fio").val(),
			form_email: $("#form_email").val(),
			form_question: $("#form_question").val(),
		},
		success
	);
	function success(data, textStatus, jqxhr){
		result = $.parseJSON(jqxhr.getResponseHeader('actionmessage'));
		if (result.type == 'success'){
			$('#form_faq').html(result.message);
			$("#actionmessage").removeClass().addClass(result.type).empty().html(result.message).show("slow");
			setTimeout('$("#actionmessage").hide("slow");', 3000);
		}
		else{
			$("#actionmessage").removeClass().addClass(result.type).empty().html(result.message).show("slow");
			setTimeout('$("#actionmessage").hide("slow");$("#add_question").removeAttr("disabled");', 3000);
		}
	}
});

</script>
{/literal}